#include<stdio.h>
#include "Python.h"
//-ID:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\include -L
// spam.c

static PyObject *SpamError;

static PyObject *
    spam_system(PyObject *self, PyObject *args)
{
    const char *command;
    int sts;

    if (!PyArg_ParseTuple(args, "s", &command))
        return NULL;
    sts = system(command);
    if (sts < 0) {
        PyErr_SetString(SpamError, "System command failed");
        return NULL;
    }
    return PyLong_FromLong(sts);
}

static PyMethodDef hello_methods[] = {
    {"system",  spam_system, METH_VARARGS,
    "Execute a shell command."},
    {NULL, NULL, 0, NULL}        /* Sentinel */
};

static PyModuleDef cModPyDem = {
		PyModuleDef_HEAD_INIT,
		"hello",                        // Module name
		"Provides some functions, but faster",  // Module description
		0,
		hello_methods                   // Structure that defines the methods
	};

PyMODINIT_FUNC PyInit_hello(void)
{
    PyObject *m;

    return PyModule_Create(&cModPyDem);
}